import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/components/layout/layouts/index.vue'
import about from '../views/About.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: 'index',
    children: [{
      path: 'index',
      component: (resolve) => require(['@/views/basicPublicServices/index.vue'], resolve),
      name: '合同数据分析看板'
    }
    ]
  },
  {
    path: '/about',
    component: about,
    children: [{
      path: 'about',
      component: (resolve) => require(['@/views/About.vue'], resolve),
      name: '数字翻牌'
    }
    ]
  },
]

const router = new VueRouter({
  mode: 'hash',
  routes
})

const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (to) {
  return VueRouterPush.call(this, to).catch(err => err)
}

export default router
